﻿package Modules.VolunteerModule
{
	import Modules.CommunicationsModule.ClientServerCommunications;
	import Modules.MainTimeLine;
	import Modules.PlayerModule.InventoryModule.Tables.Item;
	
	public class VolunteerReward
	{
		public var outstandingReward:int = 0;

		public function VolunteerReward()
		{
		}
		
		public function initVolunteerReward(data:Object){
			if(data){
				outstandingReward = data.outstandingReward;
			}
			
			MainTimeLine.root.main.townHallPanel.volunteerPanel.rewardPanel.setOutstandingReward(outstandingReward); // update UI
		}
		
		public function decreaseOutstandingReward(){
			outstandingReward = 0;
			
			ClientServerCommunications.updatePlayerVolunteerReward(outstandingReward); // update db
			MainTimeLine.root.main.townHallPanel.volunteerPanel.rewardPanel.setOutstandingReward(outstandingReward); // update UI
		}
	}
}